<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
	</script>
</head>
<body>
    <button id="btn">点击获取数据</button>
    <script>
        function sendAJAX(url) {
            return new Promise((resolve,reject) => {
                $.ajax({
                    url: "url",
                    success(arr) {
                        resolve(arr);
                    },
                    error(err) {
                        reject(err);
                    },
                    
                })
            });
        }
        let btn = document.querySelector('#btn');
        function* getData() {
            try{
                let data1 = yield sendAJAX('http://59.65.232.233:5080/api_1_0/ssoUser/2023101916543597');
                let data2 = yield sendAJAX('http://59.65.232.233:5080/api_1_0/ssoUser/2023103116255631');
            }catch (error) {
				console.error(error);
			}
		}
        btn.addEventListener('click', function(){
            const generator = getData();
            var d1 = generator.next();
            var d2 = generator.next();
            d1.value.then(
                (result) => {
                    console.log('Result:',result);
                }
            );
            d2.value.then(
                (result) => {
                    console.log('Result:',result);
                }
            )
        });

    </script>
</body>
</html>